export default {
  beforeRouteEnter(to, from, next) {
    const { keepAlivePages: toKeepAlivePages } = to.meta || {};
    if ((toKeepAlivePages || []).includes(from.name)) {
      to.meta._isNeedFresh_ = false;
    }
    next();
  },
  mounted() {
    this._isFirstEnter_ = true;
  },
  activated() {
    if (this._isFirstEnter_ || this.$route.meta._isNeedFresh_) {
      this.startAction();
    }
    this._isFirstEnter_ = false;
    this.$route.meta._isNeedFresh_ = true;
  },
};
